package com.sinping.qh.query.records;

import com.sinping.qh.query.base.Operator;
import com.sinping.qh.query.base.QueryParams;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * app 用于检查计划离线接口
 *
 * @author Tiansx
 * @create 2018-06-06 17:52
 **/
@Data
public class CheckRecordByAppQuery implements QueryParams,Serializable {

    private static final long serialVersionUID = 1468773948970939418L;
    static Map<String, String> aliasMap = new HashMap<>();
    static Map<String, Operator> operatorMap = new HashMap<>();

    /**
     * 检查记录的id
     */
    private String checkPlanId;

    /**
     * 记录状态
     */
    private List<String> checkStatus;

    static {
        aliasMap.put("checkPlanId", "check_plan_id");
        aliasMap.put("checkStatus","check_status");

        operatorMap.put("checkPlanId", Operator.eq);
        operatorMap.put("checkStatus", Operator.in);
    }

    @Override
    public String getAlias(String fieldName) {
        return aliasMap.getOrDefault(fieldName, fieldName);
    }

    @Override
    public Operator getOperators(String fieldName) {
        return operatorMap.getOrDefault(fieldName, Operator.eq);
    }



}
